/*******************************************************************************
 * This file is part of blueprint4j www.blueprint4j.org.
 * 
 *     blueprint4j is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU Lesser General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 * 
 *     blueprint4j is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU Lesser General Public License for more details.
 * 
 *     You should have received a copy of the GNU Lesser General Public License
 *     along with blueprint4j. If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
package blueprint4j.db;

import java.util.ArrayList;
import java.util.List;

public class FieldGroupBar implements java.io.Serializable {
	public enum BAR_TYPE{
		BOXES,
		TABS;
	};
	
	private List<FieldGroup> groups=new ArrayList<FieldGroup>();
	private Entity entity = null;
	private int columns;
	private BAR_TYPE type=BAR_TYPE.BOXES;

	public FieldGroupBar(int columns,Entity entity) {
		this(columns,BAR_TYPE.BOXES,entity);
	}

	public FieldGroupBar(int columns,BAR_TYPE type,Entity entity) {
		this.entity=entity;
		this.columns=columns;
		this.type=type;
		entity.setFieldGroupBar(this);
	}

	public Entity getEntity() {
		return entity;
	}
	
	public void add(FieldGroup field){
		groups.add(field);
	}
	
	public boolean contains(FieldGroup field){
		return groups.contains(field);
	}
	
	public BAR_TYPE getType(){
		return type;
	}

	public int getColumns(){
		return columns;
	}
	
	public List<FieldGroup> getGroupss(){
		return groups;
	}
}

